import { createRouter, createWebHashHistory } from 'vue-router'
import LoginView from '../views/loginView.vue'
import HomeView from '../views/homeView.vue'
import SearchView from '../views/DetailView.vue'
const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            redirect: '/counter' // 如果访问的是 localhost:5173/#/ => localhost:5173/#/home
        },
        {
            path: '/login',
            component: () => import("@/views/loginView.vue")
        }, {
            path: "/home",
            component: () => import("@/views/homeView.vue")
        },
        {
            path: '/search',
            component: () => import("@/views/DetailView.vue")
        },
        {
            path: '/counter',
            component: () => import("@/views/CounterView.vue")
        },
        {
            path: '/anothercounter',
            component: () => import("@/views/AnotherCounter.vue")
        }
        // {
        //     path: '/:pathMatch(.*)*',
        //     component: () => import("@/views/NotFound.vue")
        // }
    ]
})

export default router